﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Media.Imaging;

namespace PdfSdk.PdfViewer
{
    /// <summary>
    /// internal class ImageProvider : ItemsProvider<IEnumerable<Grid>>
    /// </summary>
    internal class ImageProviderWrapper : ObjectWrapper
    {
        public ImageProviderWrapper(object obj) : base(obj)
        {
        }

        internal InkCanvas _selectionCanvas => GetFieldValue() as InkCanvas;

        public bool IsinitializeCompleted => Convert.ToBoolean(GetPropertyValue());

        public int CurrentPage
        {
            get => Convert.ToInt32(GetPropertyValue());
            set => SetPropertyValue(value);
        }

        public int LastPage
        {
            get => Convert.ToInt32(GetPropertyValue());
            set => SetPropertyValue(value);
        }

        public Dictionary<int, BitmapSource> ImageSourceDictionary => GetPropertyValue() as Dictionary<int, BitmapSource>;

        public bool IsImageGenerated => Convert.ToBoolean(GetPropertyValue());

        public int Count() => Convert.ToInt32(InvokeMethod());

        public void ImageGenerator(int pageindex) => InvokeMethod("ImageGenerator", pageindex);
    }
}
